<template>
    <div>
     <table>
        <tr>
            <td>账号</td>
            <td>
                <input type="text" v-model="state.Lname"/>
            </td>
        </tr>
        <tr>
            <td>密码</td>
            <td>
                <input type="password" v-model="state.Lpwd"/>
            </td>
        </tr>
        <tr>
            <td>
                <input type="button" value="登录" @click="addLogins"/>
            </td>
            <td></td>
        </tr>
     </table>
    </div>
</template>

<script setup lang="ts">
import { reactive, onMounted,toRefs} from 'vue'   
import { useRoute, useRouter} from 'vue-router'
import axios from 'axios'
const router = useRouter()
const route = useRoute()

const data = reactive({
    state:{

        Lname:'',
        Lpwd:''
    }
})

const {state} = toRefs(data)

const addLogins = () => {
    axios({
        url:'https://localhost:7265/api/Member/Addlogin',
        method:'get',
        params:state.value
    }).then((res)=>{
        console.log(res)
        if(res.data.data>0){
            alert('登录成功')
          
        }else{
            alert('失败')
        }
    })
}




</script>

<style scoped>

</style>